<template>
  <iframe
    :src="value"
    draggable="false"
    style="width: 100%; height: 100%; border: none"
    v-loading="loading"
  ></iframe>
</template>

<script>
const api = window.$api.demo.threeD;
export default {
  data() {
    return {
      value: "",
      id: '',
      loading: false
    };
  },
  async created() {
    this.id = this.$route.query.id;
    let data = {
      appKey: "b6ad7c41914c423d902086d597522ad4",
      appSecret: "4cf32fcb69a8415d84c4b795799b8a6e",
      sceneId: this.id,
    };

    let res = await api.getviewtoken(data);
    this.value = `https://api.qukai3d.com/view/dt/scene?SceneId=${data.sceneId}&AccessToken=${res.data.accessToken}`
    this.loading = false
  },
};
</script>